Pop explicit credentials when switching profiles#178
Pop explicit credentials when switching profiles#178joguSD wants to merge 1 commit intoawslabs:masterfrom
Conversation
jamesls
left a comment
There was a problem hiding this comment.
I'm not sure this is the right fix. We should still be able to pull creds from env var if no explicit profile is given (aws-shell with no args). Instead I would just expect us to explicitly set the profile when invoking the CLI command.
|
@jamesls This will still allow us to pull creds from the env vars if no explicit profile is set. The code in the PR is only executed if I had thought of adding a |
|
@joguSD I also don't think popping the environment variables is the right thing to do either. I actually think we should not be setting the The best option in general would be to set the profile on the session. However, we do not have access to that as the command is ran in a subprocess. So for now the best you probably would be able to do is set |
|
@kyleknap I can see where you're coming from about the environment variables thing, but I'm not sure if it's entirely relevant in the current state of variable support of the shell. Upon entering the I really don't think the behavior of |
The CLI will prefer explicit AWS credentials in the environment variables thus ignoring the profile set by the shell. If you manually invoke a profile using the shell this will ensure that any explicit credentials are removed from the shell's environment.
Fixes #166